﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ParseForm.aspx.cs" Inherits="Cms.Web.UIBuilder.ParseForm"
    EnableViewState="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>解析页面</title>

    <script src="../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="/Scripts/Linb/runtime/js/linb-all.js" type="text/javascript"></script>
<script src="/Tools/Script.ashx?action=list&type=getformjson&formid=<%=Cms.EntLib.Request.GetString("ID") %>" type="text/javascript"></script>
   <!--
    <script src="../CmsSystem/SysModules/formlist.js" type="text/javascript"></script>
    -->

    <script type="text/javascript">
        var buttons = [{ type: "add", caption: "新增" }, { type: "modify", caption: "修改"}];
        function FORM_add() {
            alert("新增");
        }
        function FORM_modify() {
            var row = linb._pool.$c.host["list"].getActiveRow();
            if (row) {
                var id = row["id"];
                var url = "UIDesign.aspx?ID=" + id;
                window.open(url);
            }
        }
        linb.Com.load('App', function() {
            //赋值
            var p = (new linb.UI.Pane).setHeight(20).setDock("top");
            for (var i = 0; i < buttons.length; i++) {
                var fun = "FORM_" + buttons[i]["type"];
                var btn = (new linb.UI.SButton).setCaption(buttons[i]["caption"]).setTag(fun).setWidth(40).setLeft(i * 40 + 2).onClick(function() {
                    var tag = this.getProperties("tag");
                    eval(tag + "()");
                });
                p.append(btn);
            }
            p.show();
            var surl = '/Tools/Script.ashx?action=list&type=getrecordjson&param=<%=Cms.EntLib.Request.GetString("ID") %>';

            $.ajax({ url: surl, success: function(data) {
                linb._pool.$c.host["list"].setDock("fill").setRows(eval(data));
            }
            });

            //增加按钮
            linb('loading').remove();
        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
    </form>
</body>
</html>
